#pragma once
#ifndef xResult_H__
#define xResult_H__

//#include <windows.h>

#include "./skyType.h"

namespace Sky 
{


	//--------------------------------------------------------------------------------------
	// Error codes
	//--------------------------------------------------------------------------------------
	static const u32	XE_NOMEMORY		=	_HRESULT_TYPEDEF_(0x8007000EL);//E_OUTOFMEMORY;
	static const u32	XE_ARGUMENT		=	_HRESULT_TYPEDEF_(0x80070057L);//E_INVALIDARG;
	static const u32	XE_POINTER		=	_HRESULT_TYPEDEF_(0x80004003L);//E_POINTER;
	static const u32	XE_RESLOST      =   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0901);
	static const u32	XE_RESOURCE		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x090c);
	static const u32	XE_NOTIMPL		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0912);
	static const u32	XE_VERSION		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0909);
	static const u32	XE_UNKNOWN		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x090a);
	static const u32	XE_APICALL		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0910);
	static const u32	XE_COMPATIBLE	=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0902);
	static const u32	XE_NOTFOUND		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0915);
	static const u32	XE_EXISTED		=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0904);
	static const u32	XE_NOTEXISTED	=	XE_NOTFOUND;
	static const u32	XE_SOMEFAILED	=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0914);
	static const u32	XE_NOTINITIED	=	MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0916);
	//sequence of call is wrong
	static const u32	XE_CALLSEQUENCE =	MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x0920);
	//error already happened
	static const u32	XE_ALREADYERROR	=	MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x0921);
	//res or TInterface lost
	static const u32	XE_LOST			=	MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x0922);
	//
	static const u32	XE_NOTRELEASE	=	MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x0923);
	//success
	static const u32	XE_OK			=	0;//S_OK;
	//
	static const u32  XE_CONTINUE		=	MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0901);
	//
	static const u32	XE_BREAK		=	MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0902);
	//
	static const u32  XE_CONSUMED		=	MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0903);
	//
	static const u32  XE_NOTCONSUMED		=	MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0904);
	/*#define XERR_NODIRECT3D              MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0901)
	//#define XERR_NOCOMPATIBLEDEVICES     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0902)
	#define XERR_MEDIANOTFOUND           MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0903)
	//#define XERR_NONZEROREFCOUNT         MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0904)
	#define XERR_CREATINGDEVICE          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0905)
	#define XERR_RESETTINGDEVICE         MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0906)
	#define XERR_CREATINGDEVICEOBJECTS   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0907)
	#define XERR_RESETTINGDEVICEOBJECTS  MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0908)
	   

			
	#define XERR_INTERFACE				MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x090d)
	#define XERR_INVALIDAPICALL			MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x090e)
	#define XERR_INVALIDMEDIATYPE		   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0911)
	#define XERR_ALLFAILED			   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0913)
	//#define XERR_SOMEFAILED			   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0914)
	#define XERR_EXIST				   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0918)
	#define XERR_NOTEXIST				   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0919)

	#define XSUC_SUCCESS				   S_OK
	#define XSUC_BREAK				       MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0902)
	#define XSUC_ALLSUCC				   MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0903)
	#define XSUC_SOMESUCC				   MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0904)
	#define XSUC_HAVEDONE				   MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0905)
	#define XSUC_RETURN					   MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x0906)*/
}
#endif // xResult_H__
